home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / ltsample.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  3.3 KB  |  108 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11. // LTSample.cpp : Defines the class behaviors for the application.
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "LTSample.h"
  16. #include "VpWnd.h"
  17. #include "LTSampleDlg.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CLTSampleApp
  27.  
  28. BEGIN_MESSAGE_MAP(CLTSampleApp, CWinApp)
  29.     //{{AFX_MSG_MAP(CLTSampleApp)
  30.         // NOTE - the ClassWizard will add and remove mapping macros here.
  31.         //    DO NOT EDIT what you see in these blocks of generated code!
  32.     //}}AFX_MSG
  33.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CLTSampleApp construction
  38.  
  39. CLTSampleApp::CLTSampleApp()
  40. {
  41.     // TODO: add construction code here,
  42.     // Place all significant initialization in InitInstance
  43. }
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // The one and only CLTSampleApp object
  47.  
  48. CLTSampleApp theApp;
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CLTSampleApp initialization
  52.  
  53. BOOL CLTSampleApp::InitInstance()
  54. {
  55.     // Initialize OLE libraries
  56.     if (!AfxOleInit())
  57.     {
  58.         AfxMessageBox(IDP_OLE_INIT_FAILED);
  59.         return FALSE;
  60.     }
  61.  
  62.     AfxEnableControlContainer();
  63.  
  64.     // Standard initialization
  65.     // If you are not using these features and wish to reduce the size
  66.     //  of your final executable, you should remove from the following
  67.     //  the specific initialization routines you do not need.
  68.  
  69. #ifdef _AFXDLL
  70.     Enable3dControls();            // Call this when using MFC in a shared DLL
  71. #else
  72.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  73. #endif
  74.  
  75.     // Parse the command line to see if launched as OLE server
  76.     if (RunEmbedded() || RunAutomated())
  77.     {
  78.         // Register all OLE server (factories) as running.  This enables the
  79.         //  OLE libraries to create objects from other applications.
  80.         COleTemplateServer::RegisterAll();
  81.     }
  82.     else
  83.     {
  84.         // When a server application is launched stand-alone, it is a good idea
  85.         //  to update the system registry in case it has been damaged.
  86.         COleObjectFactory::UpdateRegistryAll();
  87.     }
  88.  
  89.     CLTSampleDlg dlg;
  90.     m_pMainWnd = &dlg;
  91.     int nResponse = dlg.DoModal();
  92.     if (nResponse == IDOK)
  93.     {
  94.         // TODO: Place code here to handle when the dialog is
  95.         //  dismissed with OK
  96.     }
  97.     else if (nResponse == IDCANCEL)
  98.     {
  99.         // TODO: Place code here to handle when the dialog is
  100.         //  dismissed with Cancel
  101.     }
  102.  
  103.     // Since the dialog has been closed, return FALSE so that we exit the
  104.     //  application, rather than start the application's message pump.
  105.     return FALSE;
  106. }
  107.  
  108.